import logging
from flask import current_app
from flask_migrate import Migrate, MigrateCommand
from flask_script import Manager
from info import create_app,db

app = create_app()

manager = Manager(app)
Migrate(app=app, db=db)
manager.add_command('db', MigrateCommand)

@app.route('/')
def index():
    # logging.basicConfig(level=logging.DEBUG)
    #
    # logging.warning('warning ~~ 18 years old not not watch ')
    # logging.error('error~~~~')
    # logging.info('infofefioadfiajdfk----------')
    # logging.debug('debug!!!!!!!!!!')

    current_app.logger.debug('debug')
    current_app.logger.error('error')


    return 'index'

if __name__ == '__main__':
    # app.run()
    manager.run()